<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	System.out.print(basePath);
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>TI - 忘记密码</title>
<script src="js/jquery.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/bootstrap.min.js"></script>
<style type="text/css">
a:link {
	text-decoration: none;
}

a:visited {
	text-decoration: none;
}

a:hover {
	text-decoration: none;
}

a:active {
	text-decoration: none;
}
</style>
<script type="text/javascript">
	$(document).ready(function() {
		$("#d_message").hide();
		$("#repeatCode").click(function() {
			$("#d_verifyCode").empty();
			$("#d_verifyCode").append("<img src='/ti/passwordUpdate?r="+Math.random()+"'>");
		});
		$("#pwdUpdateButton").click(function(){
			var data = $("#pwdUpdateForm").serialize();
			$.ajax({
				type : "POST",
				url : "pwdUpdate.action",
				data : data,
				success : function(msg) {
					$("#pwdMessage").empty();
					$("#pwdMessage").append(msg);
					$("#d_message").show();
					$("#d_verifyCode").empty();
					$("#d_verifyCode").append("<img src='/ti/passwordUpdate?r="+Math.random()+"'>");
				},
				error : function(e) {
					alert("对不起，后台处理发生异常，请联系管理员!");
				}
			});
		});
	}); 
</script>
</head>
<body>
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column" style="margin-top: 15%">
				<form class="form-horizontal" role="form" id="pwdUpdateForm">
					<div class="form-group">
						<label for="inputEmail3" class="col-sm-4 control-label">邮箱:</label>
						<div class="col-sm-5">
							<input class="form-control" id="userMail" name="user.mail"
								type="email" />
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword3" class="col-sm-4 control-label">验证码:</label>
						<!-- verifyCode -->
						<div class="col-sm-2">
							<input class="form-control" id="verifyCode" name="verifyCode"
								type="email" />
						</div>
						<div class="col-sm-2" id="d_verifyCode">
							<img src="/ti/passwordUpdate">
						</div>
						<div class="col-sm-1">
							<a href="javascript:void(0)" id="repeatCode">看不清?</a>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-sm-8 control-label"></label>
						<div class="col-sm-1">
							<button type="button" class="btn btn-primary" id="pwdUpdateButton">提交</button>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-sm-4 control-label"></label>
						<div class="col-sm-5">
							<div class="alert alert-dismissable alert-success" id="d_message">
								<button type="button" class="close" data-dismiss="alert"
									aria-hidden="true">X</button>
								<h4>提示!</h4>
								<strong>&nbsp;&nbsp;&nbsp;&nbsp;您好!</strong>
								<span id="pwdMessage">
									您的密码已经通过邮件发送至您的邮箱，请注意查收。
								</span>
									返回<a href="login.jsp">登陆页</a>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>